import { defHttp } from "@/utils/http";

// ERP 药片类型 VO
export interface TypePillVO {
	id: number; // 药片类型ID
	name: string; // 药片类型名称
	sqNumb: number; // 序号
	ratio: number; // 系数
	grpId: number; // 分组
}

// ERP 药片类型 API
export const TypePillApi = {
	// 查询药片类型分页
	getTypePillPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/drugs-type/page`, params });
	},

	// 查询药片类型详情
	getTypePill: async (id: number) => {
		return await defHttp.get({ url: `/whs/drugs-type/get?id=` + id });
	},

	// 新增药片类型
	createTypePill: async (data: TypePillVO) => {
		return await defHttp.post({ url: `/whs/drugs-type/create`, data });
	},

	// 修改药片类型
	updateTypePill: async (data: TypePillVO) => {
		return await defHttp.put({ url: `/whs/drugs-type/update`, data });
	},

	// 删除药片类型
	deleteTypePill: async (id: number) => {
		return await defHttp.delete({ url: `/whs/drugs-type/delete?id=` + id });
	},

	// 导出药片类型 Excel
	exportTypePill: async (params: any) => {
		return await defHttp.download({ url: `/whs/drugs-type/export-excel`, params });
	}
};
